kmpkg_check_linkage(ONLY_STATIC_LIBRARY)

kmpkg_from_gitee(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO kumo-hub/protobuf
    REF "v${VERSION}"
    SHA512 a1ccdad27771b3ed721ceb607c570b690f08bbef032548e449c357d4da2d1ee86e22e3fe4a4f9b20e55b6253e85e46225a70c08e0404c8b06386f1f7a34c3fb7
    HEAD_REF main
    PATCHES
        fix-cmake.patch
)

kmpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}/third_party/utf8_range"
    OPTIONS
        "-Dutf8_range_ENABLE_TESTS=off"
)

kmpkg_cmake_install()
kmpkg_cmake_config_fixup(PACKAGE_NAME "utf8_range" CONFIG_PATH "lib/cmake/utf8_range")

kmpkg_fixup_pkgconfig()
kmpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

kmpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/third_party/utf8_range/LICENSE")
